from django.contrib import admin
from django.urls import path
from . import views
from rest_framework.routers import DefaultRouter

urlpatterns = [
    path('test/', views.test, name='test'),
    path('isdeletestu/', views.IsDeleteStudentsViewSet.as_view({'get': 'list'}), name='isdeletestu'),
    path('isdeletestu/<pk>/', views.IsDeleteStudentsViewSet.as_view({'get': 'retrieve', 'put': 'update'}), name='isdeletestu_operate'),
    path('isdeletecla/', views.IsDeleteClassesViewSet.as_view({'get': 'list'}), name='isdeletecla'),
    path('isdeletecla/<pk>/', views.IsDeleteClassesViewSet.as_view({'get': 'retrieve', 'put': 'update'}), name='isdeletecla_operate'),
    # path('students/', views.StudentsViewSet.as_view({'get': 'list', 'post': 'create'}), name='student'),
    # path('students/<pk>/', views.StudentsViewSet.as_view({'get': 'retrieve', 'put': 'update', 'delete': 'destroy'}), name='student_operate')
]
router = DefaultRouter()
router.register('classes', views.ClassesViewSet)
router.register('students', views.StudentsViewSet)
urlpatterns += router.urls
